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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: F = None
        self.y: C = None
        self.v: C = None
        self.s: A = None
        self.z: E = None
        self.txt = txt

a = A("a")
n = B("n")
i = C("i")
f = D("f")
l = E("l")
h = F("h")
k = F("k")

a.o = f
n.s = l
n.v = f
n.t = k
i.s = l
f.u = a
f.z = h
f.q = l
l.z = k
l.q = a
h.r = f
h.q = k
h.y = i
h.v = i
h.s = a
h.z = l
k.r = f
k.q = h
k.y = i
k.v = i
k.s = a
k.z = l
assert k.s.o.u.o.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: F = None
        self.y: C = None
        self.v: C = None
        self.s: A = None
        self.z: E = None
        self.txt = txt

a = A("a")
n = B("n")
i = C("i")
f = D("f")
l = E("l")
h = F("h")
k = F("k")

a.o = f
n.s = l
n.v = f
n.t = k
i.s = l
f.u = a
f.z = h
f.q = l
l.z = k
l.q = a
h.r = f
h.q = k
h.y = i
h.v = i
h.s = a
h.z = l
k.r = f
k.q = h
k.y = i
k.v = i
k.s = a
k.z = l
assert k.s.o.u.o.u.o.txt == "f"