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

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

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

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

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

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

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

l.t = j
j.s = i
m.q = e
m.v = i
m.y = i
m.t = n
i.u = h
n.z = l
n.q = h
n.u = m
n.r = e
h.z = m
e.t = j
assert e.t.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

l.t = j
j.s = i
m.q = e
m.v = i
m.y = i
m.t = n
i.u = h
n.z = l
n.q = h
n.u = m
n.r = e
h.z = m
e.t = j
assert e.t.s.u.txt == "h"