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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

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

m = A("m")
c = B("c")
d = C("d")
g = D("g")
h = E("h")
a = F("a")
j = A("j")
k = C("k")
e = F("e")
n = B("n")

m.o = k
m.z = d
c.p = j
c.r = g
c.u = g
c.q = g
c.s = g
c.x = n
d.w = k
g.r = c
g.u = e
g.s = m
g.q = m
h.q = m
h.v = e
h.z = d
h.t = a
a.y = h
a.p = h
a.u = c
a.r = c
j.o = k
j.z = d
k.w = d
e.y = h
e.p = h
e.u = n
e.r = n
n.p = m
n.r = g
n.u = g
n.q = g
n.s = g
n.x = c
assert e.r.p.z.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

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

m = A("m")
c = B("c")
d = C("d")
g = D("g")
h = E("h")
a = F("a")
j = A("j")
k = C("k")
e = F("e")
n = B("n")

m.o = k
m.z = d
c.p = j
c.r = g
c.u = g
c.q = g
c.s = g
c.x = n
d.w = k
g.r = c
g.u = e
g.s = m
g.q = m
h.q = m
h.v = e
h.z = d
h.t = a
a.y = h
a.p = h
a.u = c
a.r = c
j.o = k
j.z = d
k.w = d
e.y = h
e.p = h
e.u = n
e.r = n
n.p = m
n.r = g
n.u = g
n.q = g
n.s = g
n.x = c
assert e.r.p.z.w.w.w.w.txt == "d"