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

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

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

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

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

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

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

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

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

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

g.q = a
g.p = i
g.v = f
g.x = l
f.o = i
f.u = e
f.w = a
f.z = g
j.y = e
j.s = e
j.t = l
l.y = i
l.o = j
l.s = g
e.y = i
e.o = i
e.s = g
i.y = l
i.s = l
i.t = l
a.o = j
a.u = l
a.w = f
a.z = g
assert f.z.p.t.y.y.o.t.txt == "l"