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

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

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

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

g = A("g")
n = B("n")
l = C("l")
e = D("e")
k = A("k")
f = D("f")
j = A("j")
i = B("i")
d = D("d")
a = D("a")

g.x = l
g.z = l
g.p = j
g.q = e
n.v = l
n.s = l
n.x = i
l.o = j
l.u = f
l.s = i
e.v = l
e.y = l
e.u = a
e.r = k
k.x = l
k.z = l
k.p = g
k.q = d
f.v = l
f.y = l
f.u = e
f.r = k
j.x = l
j.z = l
j.p = k
j.q = d
i.v = l
i.s = l
i.x = n
d.v = l
d.y = l
d.u = f
d.r = g
a.v = l
a.y = l
a.u = f
a.r = g
assert i.v.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.p: A = None
        self.q: D = None
        self.txt = txt

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

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

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

g = A("g")
n = B("n")
l = C("l")
e = D("e")
k = A("k")
f = D("f")
j = A("j")
i = B("i")
d = D("d")
a = D("a")

g.x = l
g.z = l
g.p = j
g.q = e
n.v = l
n.s = l
n.x = i
l.o = j
l.u = f
l.s = i
e.v = l
e.y = l
e.u = a
e.r = k
k.x = l
k.z = l
k.p = g
k.q = d
f.v = l
f.y = l
f.u = e
f.r = k
j.x = l
j.z = l
j.p = k
j.q = d
i.v = l
i.s = l
i.x = n
d.v = l
d.y = l
d.u = f
d.r = g
a.v = l
a.y = l
a.u = f
a.r = g
assert i.v.u.y.txt == "l"