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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: B = None
        self.x: E = None
        self.q: E = None
        self.y: C = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: B = None
        self.z: E = None
        self.p: F = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: B = None
        self.x: E = None
        self.q: E = None
        self.y: C = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: B = None
        self.z: E = None
        self.p: F = None
        self.u: B = None
        self.txt = txt

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

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

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