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

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

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

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

e = A("e")
a = B("a")
d = C("d")
g = D("g")
k = D("k")
m = D("m")
b = C("b")
j = D("j")
c = B("c")

e.v = d
e.t = d
e.w = c
a.u = c
a.y = k
d.w = b
g.v = d
g.y = e
g.u = a
k.v = b
k.y = e
k.u = c
m.v = b
m.y = e
m.u = a
b.w = d
j.v = d
j.y = e
j.u = c
c.u = a
c.y = k
assert k.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: B = None
        self.t: C = None
        self.txt = txt

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

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

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

e = A("e")
a = B("a")
d = C("d")
g = D("g")
k = D("k")
m = D("m")
b = C("b")
j = D("j")
c = B("c")

e.v = d
e.t = d
e.w = c
a.u = c
a.y = k
d.w = b
g.v = d
g.y = e
g.u = a
k.v = b
k.y = e
k.u = c
m.v = b
m.y = e
m.u = a
b.w = d
j.v = d
j.y = e
j.u = c
c.u = a
c.y = k
assert k.u.u.u.u.txt == "a"