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

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

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

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

j = A("j")
g = B("g")
d = C("d")
a = D("a")
k = C("k")
h = A("h")
f = A("f")
l = B("l")
c = A("c")
b = B("b")

j.v = k
j.u = h
j.y = h
j.s = d
g.y = a
d.q = h
d.z = g
a.s = d
a.w = k
a.t = f
k.q = j
k.z = l
h.v = d
h.u = c
h.s = k
h.y = j
f.v = d
f.s = d
f.u = j
f.y = c
l.y = a
c.v = d
c.s = d
c.u = f
c.y = h
b.y = a
assert h.v.z.y.t.u.v.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.s: C = None
        self.y: A = None
        self.txt = txt

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

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

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

j = A("j")
g = B("g")
d = C("d")
a = D("a")
k = C("k")
h = A("h")
f = A("f")
l = B("l")
c = A("c")
b = B("b")

j.v = k
j.u = h
j.y = h
j.s = d
g.y = a
d.q = h
d.z = g
a.s = d
a.w = k
a.t = f
k.q = j
k.z = l
h.v = d
h.u = c
h.s = k
h.y = j
f.v = d
f.s = d
f.u = j
f.y = c
l.y = a
c.v = d
c.s = d
c.u = f
c.y = h
b.y = a
assert h.v.z.y.t.u.v.z.y.txt == "a"