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

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

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

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

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

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

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

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

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

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

m.z = c
m.u = k
e.v = f
k.y = m
k.x = m
k.r = l
a.y = m
a.x = m
a.v = c
a.t = e
g.y = c
g.v = c
g.x = m
g.t = f
l.y = c
l.x = c
l.v = m
l.t = e
f.v = e
i.y = c
i.x = c
i.r = l
c.z = m
c.u = i
assert g.x.z.u.r.v.z.z.u.txt == "k"