#!/usr/bin/perl -w

use v5.16;
use strict;

my ($row, $col) = (2981, 3075);

my $num = 20151125;
my ($c, $r) = (1, 1);
while ($col != $c || $row != $r) {
	$num = $num * 252533 % 33554393;
	$r--; $c++;
	if (!$r) {
		$r = $c;
		$c = 1;
	}
}
say "$r, $c = $num";
