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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: D = None
        self.u: A = None
        self.v: F = None
        self.txt = txt

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

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

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

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

l = A("l")
i = B("i")
n = C("n")
j = D("j")
k = E("k")
c = F("c")
f = E("f")
e = F("e")
m = A("m")

l.t = n
i.r = n
i.x = j
i.u = m
i.v = e
n.z = i
j.t = f
j.s = e
k.o = j
k.p = j
k.y = c
k.v = n
c.p = i
f.o = j
f.p = j
f.y = c
f.v = n
e.p = i
m.t = n
assert n.z.u.t.z.u.t.z.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: D = None
        self.u: A = None
        self.v: F = None
        self.txt = txt

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

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

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

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

l = A("l")
i = B("i")
n = C("n")
j = D("j")
k = E("k")
c = F("c")
f = E("f")
e = F("e")
m = A("m")

l.t = n
i.r = n
i.x = j
i.u = m
i.v = e
n.z = i
j.t = f
j.s = e
k.o = j
k.p = j
k.y = c
k.v = n
c.p = i
f.o = j
f.p = j
f.y = c
f.v = n
e.p = i
m.t = n
assert n.z.u.t.z.u.t.z.x.t.txt == "f"