class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.q: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.q: A = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
h = C("h")
k = D("k")
l = C("l")
b = C("b")
a = C("a")
i = C("i")
d = A("d")

e.t = b
e.x = d
e.q = f
e.u = k
f.u = k
f.y = d
f.q = d
h.t = f
h.q = f
h.y = k
k.t = i
l.t = f
l.q = f
l.y = k
b.t = f
b.q = f
b.y = k
a.t = f
a.q = f
a.y = k
i.t = f
i.q = f
i.y = k
d.t = i
d.x = e
d.q = f
d.u = k
assert k.t.q.q.x.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.q: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.q: A = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
h = C("h")
k = D("k")
l = C("l")
b = C("b")
a = C("a")
i = C("i")
d = A("d")

e.t = b
e.x = d
e.q = f
e.u = k
f.u = k
f.y = d
f.q = d
h.t = f
h.q = f
h.y = k
k.t = i
l.t = f
l.q = f
l.y = k
b.t = f
b.q = f
b.y = k
a.t = f
a.q = f
a.y = k
i.t = f
i.q = f
i.y = k
d.t = i
d.x = e
d.q = f
d.u = k
assert k.t.q.q.x.t.t.txt == "f"