class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: B = None
        self.x: B = None
        self.z: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: A = None
        self.u: E = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.x: D = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: F = None
        self.w: B = None
        self.z: E = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

n = A("n")
m = B("m")
b = C("b")
f = D("f")
c = E("c")
e = F("e")
j = F("j")
d = D("d")

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: A = None
        self.u: E = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.x: D = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: F = None
        self.w: B = None
        self.z: E = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

n = A("n")
m = B("m")
b = C("b")
f = D("f")
c = E("c")
e = F("e")
j = F("j")
d = D("d")

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