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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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

n.t = c
h.t = m
c.o = l
e.y = a
e.w = l
e.z = l
e.t = m
m.r = c
l.p = k
a.r = c
b.t = c
j.t = a
k.t = m
assert h.t.r.o.p.t.r.o.p.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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

n.t = c
h.t = m
c.o = l
e.y = a
e.w = l
e.z = l
e.t = m
m.r = c
l.p = k
a.r = c
b.t = c
j.t = a
k.t = m
assert h.t.r.o.p.t.r.o.p.t.r.txt == "c"