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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

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

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

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