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

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

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

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

g = A("g")
n = B("n")
m = C("m")
a = D("a")
l = D("l")
b = C("b")
h = A("h")
f = D("f")
e = B("e")
i = D("i")

g.u = h
g.y = h
g.o = b
g.s = b
n.u = b
n.v = e
n.s = m
n.p = m
m.z = e
a.v = e
a.y = b
a.u = f
l.v = e
l.y = b
l.u = i
b.z = n
h.u = g
h.y = g
h.o = b
h.s = m
f.v = e
f.y = b
f.u = i
e.u = b
e.s = b
e.v = n
e.p = m
i.v = n
i.y = b
i.u = l
assert l.v.v.u.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: C = None
        self.s: C = None
        self.y: A = None
        self.txt = txt

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

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

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

g = A("g")
n = B("n")
m = C("m")
a = D("a")
l = D("l")
b = C("b")
h = A("h")
f = D("f")
e = B("e")
i = D("i")

g.u = h
g.y = h
g.o = b
g.s = b
n.u = b
n.v = e
n.s = m
n.p = m
m.z = e
a.v = e
a.y = b
a.u = f
l.v = e
l.y = b
l.u = i
b.z = n
h.u = g
h.y = g
h.o = b
h.s = m
f.v = e
f.y = b
f.u = i
e.u = b
e.s = b
e.v = n
e.p = m
i.v = n
i.y = b
i.u = l
assert l.v.v.u.z.u.z.txt == "n"