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

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

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

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

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

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

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

k.u = j
k.z = l
k.r = h
i.o = k
c.y = h
c.u = m
c.p = i
e.s = h
e.o = c
l.y = m
l.w = k
l.u = k
l.o = c
m.u = h
m.s = h
h.o = k
j.u = h
j.s = i
assert l.o.p.o.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

k.u = j
k.z = l
k.r = h
i.o = k
c.y = h
c.u = m
c.p = i
e.s = h
e.o = c
l.y = m
l.w = k
l.u = k
l.o = c
m.u = h
m.s = h
h.o = k
j.u = h
j.s = i
assert l.o.p.o.r.o.txt == "k"