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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: B = None
        self.txt = txt

k = A("k")
e = B("e")
c = C("c")
l = D("l")
b = E("b")
f = F("f")
h = A("h")

k.w = b
k.o = b
k.x = c
e.u = f
c.x = e
l.t = b
l.o = e
l.y = c
b.w = l
b.o = l
b.p = l
b.x = l
b.u = e
f.p = l
f.t = e
h.w = b
h.o = b
h.x = c
assert l.o.u.p.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: E = None
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: B = None
        self.txt = txt

k = A("k")
e = B("e")
c = C("c")
l = D("l")
b = E("b")
f = F("f")
h = A("h")

k.w = b
k.o = b
k.x = c
e.u = f
c.x = e
l.t = b
l.o = e
l.y = c
b.w = l
b.o = l
b.p = l
b.x = l
b.u = e
f.p = l
f.t = e
h.w = b
h.o = b
h.x = c
assert l.o.u.p.o.u.txt == "f"