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

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

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

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

c = A("c")
l = B("l")
m = C("m")
k = D("k")
g = A("g")
i = D("i")
e = A("e")
a = A("a")

c.t = l
c.v = l
c.w = m
c.x = k
l.v = m
l.z = c
m.v = l
m.s = l
k.y = a
g.t = l
g.v = l
g.w = m
g.x = i
i.y = e
e.t = l
e.v = l
e.w = m
e.x = i
a.t = l
a.v = l
a.w = m
a.x = i
assert g.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.w: C = None
        self.x: D = None
        self.txt = txt

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

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

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

c = A("c")
l = B("l")
m = C("m")
k = D("k")
g = A("g")
i = D("i")
e = A("e")
a = A("a")

c.t = l
c.v = l
c.w = m
c.x = k
l.v = m
l.z = c
m.v = l
m.s = l
k.y = a
g.t = l
g.v = l
g.w = m
g.x = i
i.y = e
e.t = l
e.v = l
e.w = m
e.x = i
a.t = l
a.v = l
a.w = m
a.x = i
assert g.v.v.v.txt == "l"