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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

g = A("g")
b = B("b")
n = C("n")
c = D("c")
f = E("f")
e = B("e")
j = D("j")
m = E("m")
i = C("i")
k = D("k")

g.s = c
g.v = i
b.q = f
n.p = j
n.y = g
n.s = g
n.o = i
c.z = j
c.p = m
c.w = g
f.u = c
e.q = m
j.z = c
j.p = m
j.w = g
m.u = c
i.p = j
i.y = g
i.s = g
i.o = n
k.z = c
k.p = m
k.w = g
assert n.s.v.o.s.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

g = A("g")
b = B("b")
n = C("n")
c = D("c")
f = E("f")
e = B("e")
j = D("j")
m = E("m")
i = C("i")
k = D("k")

g.s = c
g.v = i
b.q = f
n.p = j
n.y = g
n.s = g
n.o = i
c.z = j
c.p = m
c.w = g
f.u = c
e.q = m
j.z = c
j.p = m
j.w = g
m.u = c
i.p = j
i.y = g
i.s = g
i.o = n
k.z = c
k.p = m
k.w = g
assert n.s.v.o.s.s.w.txt == "g"