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

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

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

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

e = A("e")
j = B("j")
h = C("h")
f = D("f")
d = C("d")
n = A("n")
i = C("i")
l = B("l")

e.y = d
j.t = i
j.u = e
j.x = f
h.q = j
h.t = j
f.y = l
f.r = e
d.q = j
d.t = l
n.y = h
i.q = l
i.t = l
l.t = h
l.u = e
l.x = f
assert l.x.y.u.y.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

e = A("e")
j = B("j")
h = C("h")
f = D("f")
d = C("d")
n = A("n")
i = C("i")
l = B("l")

e.y = d
j.t = i
j.u = e
j.x = f
h.q = j
h.t = j
f.y = l
f.r = e
d.q = j
d.t = l
n.y = h
i.q = l
i.t = l
l.t = h
l.u = e
l.x = f
assert l.x.y.u.y.t.u.txt == "e"