class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.u: B = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: C = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.w: F = None
        self.p: D = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: F = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.z: A = None
        self.p: A = None
        self.v: C = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.s: A = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

a = A("a")
g = B("g")
n = C("n")
b = D("b")
f = E("f")
e = F("e")
m = F("m")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: C = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.w: F = None
        self.p: D = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: F = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.z: A = None
        self.p: A = None
        self.v: C = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.s: A = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

a = A("a")
g = B("g")
n = C("n")
b = D("b")
f = E("f")
e = F("e")
m = F("m")

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