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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.t: D = None
        self.r: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.t: D = None
        self.r: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

l.z = e
m.o = j
m.y = h
k.w = m
k.y = m
k.r = m
k.t = e
k.p = j
e.r = k
e.o = l
d.o = e
d.t = e
j.t = e
j.y = l
j.w = m
h.o = e
h.t = e
assert e.r.p.t.txt == "e"