class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: E = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: F = None
        self.y: F = None
        self.txt = txt

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

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

i.s = a
i.p = a
l.u = f
d.o = b
d.y = b
d.p = j
d.w = j
c.z = l
c.q = l
c.o = b
j.s = b
j.v = b
j.y = b
b.x = d
b.v = d
n.s = a
n.p = a
f.u = l
h.s = c
h.p = c
a.z = l
a.o = b
a.q = f
assert h.p.q.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: E = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: F = None
        self.y: F = None
        self.txt = txt

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

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

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