class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.p: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.p: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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