class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: F = None
        self.z: A = None
        self.s: C = None
        self.r: I = None
        self.x: I = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: G = None
        self.q: G = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.r: B = None
        self.u: I = None
        self.v: F = None
        self.t: G = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.y: H = None
        self.o: I = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.p: E = None
        self.txt = txt

c = A("c")
n = B("n")
a = C("a")
l = D("l")
k = E("k")
b = F("b")
j = G("j")
e = H("e")
d = I("d")
f = B("f")

c.r = f
c.s = k
n.q = b
n.y = b
n.z = c
n.p = c
n.s = a
n.r = d
n.x = d
n.v = f
a.s = k
a.r = j
a.q = j
a.u = j
l.z = n
l.r = n
l.o = e
l.u = d
l.v = b
l.w = b
l.t = j
k.u = n
b.u = c
b.t = l
b.y = e
b.o = d
b.p = a
j.u = d
j.x = a
e.v = l
e.x = l
e.r = j
d.r = a
d.o = c
d.p = k
f.q = b
f.y = b
f.z = c
f.p = c
f.s = a
f.r = d
f.x = d
f.v = n
assert j.u.o.s.u.x.o.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: F = None
        self.z: A = None
        self.s: C = None
        self.r: I = None
        self.x: I = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: G = None
        self.q: G = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.r: B = None
        self.u: I = None
        self.v: F = None
        self.t: G = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.y: H = None
        self.o: I = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.p: E = None
        self.txt = txt

c = A("c")
n = B("n")
a = C("a")
l = D("l")
k = E("k")
b = F("b")
j = G("j")
e = H("e")
d = I("d")
f = B("f")

c.r = f
c.s = k
n.q = b
n.y = b
n.z = c
n.p = c
n.s = a
n.r = d
n.x = d
n.v = f
a.s = k
a.r = j
a.q = j
a.u = j
l.z = n
l.r = n
l.o = e
l.u = d
l.v = b
l.w = b
l.t = j
k.u = n
b.u = c
b.t = l
b.y = e
b.o = d
b.p = a
j.u = d
j.x = a
e.v = l
e.x = l
e.r = j
d.r = a
d.o = c
d.p = k
f.q = b
f.y = b
f.z = c
f.p = c
f.s = a
f.r = d
f.x = d
f.v = n
assert j.u.o.s.u.x.o.s.u.txt == "n"