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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
l = C("l")
e = D("e")
d = C("d")
c = D("c")
k = B("k")

g.p = d
j.s = c
j.w = k
j.z = k
l.v = e
l.p = g
e.z = k
e.u = c
e.o = c
d.v = e
d.p = g
c.z = k
c.u = e
c.o = e
k.s = e
k.w = j
k.z = j
assert j.w.s.o.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
l = C("l")
e = D("e")
d = C("d")
c = D("c")
k = B("k")

g.p = d
j.s = c
j.w = k
j.z = k
l.v = e
l.p = g
e.z = k
e.u = c
e.o = c
d.v = e
d.p = g
c.z = k
c.u = e
c.o = e
k.s = e
k.w = j
k.z = j
assert j.w.s.o.o.u.txt == "c"