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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: B = None
        self.q: D = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

a = A("a")
l = B("l")
i = C("i")
f = D("f")
h = E("h")
e = F("e")
b = B("b")

a.p = e
l.t = b
l.v = a
i.o = b
i.t = h
i.w = f
i.v = f
f.y = b
f.w = i
f.x = i
f.r = i
f.z = h
h.u = a
e.o = i
e.s = i
e.u = l
e.r = l
e.q = f
b.t = l
b.v = a
assert h.u.p.o.w.z.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: B = None
        self.q: D = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

a = A("a")
l = B("l")
i = C("i")
f = D("f")
h = E("h")
e = F("e")
b = B("b")

a.p = e
l.t = b
l.v = a
i.o = b
i.t = h
i.w = f
i.v = f
f.y = b
f.w = i
f.x = i
f.r = i
f.z = h
h.u = a
e.o = i
e.s = i
e.u = l
e.r = l
e.q = f
b.t = l
b.v = a
assert h.u.p.o.w.z.u.p.txt == "e"