class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

k.q = f
k.z = f
j.o = e
h.w = f
f.z = i
f.u = k
g.v = b
g.p = j
g.y = j
g.s = f
g.u = f
m.z = f
m.p = f
m.s = h
m.y = h
m.u = e
e.z = f
e.p = f
e.s = h
e.y = h
e.u = m
b.q = f
b.z = f
i.q = f
i.z = f
assert m.s.w.z.z.z.z.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

k.q = f
k.z = f
j.o = e
h.w = f
f.z = i
f.u = k
g.v = b
g.p = j
g.y = j
g.s = f
g.u = f
m.z = f
m.p = f
m.s = h
m.y = h
m.u = e
e.z = f
e.p = f
e.s = h
e.y = h
e.u = m
b.q = f
b.z = f
i.q = f
i.z = f
assert m.s.w.z.z.z.z.u.q.txt == "f"