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

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

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

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

e = A("e")
j = B("j")
l = C("l")
c = D("c")
g = A("g")
a = D("a")

e.w = c
e.t = j
j.t = l
l.z = g
l.w = g
l.r = e
c.u = g
c.o = l
g.w = a
g.t = j
a.u = g
a.o = l
assert j.t.z.t.t.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: B = None
        self.txt = txt

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

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

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

e = A("e")
j = B("j")
l = C("l")
c = D("c")
g = A("g")
a = D("a")

e.w = c
e.t = j
j.t = l
l.z = g
l.w = g
l.r = e
c.u = g
c.o = l
g.w = a
g.t = j
a.u = g
a.o = l
assert j.t.z.t.t.w.t.txt == "j"