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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: E = None
        self.v: B = None
        self.t: D = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.o: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: E = None
        self.v: B = None
        self.t: D = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.o: D = None
        self.txt = txt

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

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