class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: E = None
        self.w: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: F = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: F = None
        self.v: C = None
        self.txt = txt

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

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

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