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

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

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

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

j = A("j")
a = B("a")
f = C("f")
c = D("c")
i = D("i")
e = A("e")
k = C("k")
g = D("g")

j.y = i
j.o = e
j.r = e
j.t = a
a.u = k
a.s = f
f.x = i
c.r = i
c.u = a
i.r = g
i.u = a
e.y = i
e.o = j
e.r = j
e.t = a
k.x = g
g.r = i
g.u = a
assert i.u.s.x.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: A = None
        self.r: A = None
        self.t: B = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
f = C("f")
c = D("c")
i = D("i")
e = A("e")
k = C("k")
g = D("g")

j.y = i
j.o = e
j.r = e
j.t = a
a.u = k
a.s = f
f.x = i
c.r = i
c.u = a
i.r = g
i.u = a
e.y = i
e.o = j
e.r = j
e.t = a
k.x = g
g.r = i
g.u = a
assert i.u.s.x.r.r.txt == "i"