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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.w: D = None
        self.o: B = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.x: C = None
        self.q: A = None
        self.u: D = None
        self.txt = txt

g = A("g")
n = B("n")
c = C("c")
a = D("a")
d = E("d")
j = D("j")
b = C("b")
m = E("m")
h = B("h")

g.z = a
g.s = a
g.o = h
g.y = b
g.x = c
n.v = g
n.x = c
c.s = m
c.v = g
c.x = g
c.w = j
c.o = n
a.x = d
a.v = g
d.y = b
d.x = b
d.w = n
d.q = g
d.u = a
j.x = m
j.v = g
b.s = m
b.v = g
b.x = g
b.w = j
b.o = n
m.y = b
m.x = b
m.w = h
m.q = g
m.u = j
h.v = g
h.x = c
assert j.x.u.x.w.x.s.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: B = None
        self.y: C = None
        self.s: D = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.w: D = None
        self.o: B = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.x: C = None
        self.q: A = None
        self.u: D = None
        self.txt = txt

g = A("g")
n = B("n")
c = C("c")
a = D("a")
d = E("d")
j = D("j")
b = C("b")
m = E("m")
h = B("h")

g.z = a
g.s = a
g.o = h
g.y = b
g.x = c
n.v = g
n.x = c
c.s = m
c.v = g
c.x = g
c.w = j
c.o = n
a.x = d
a.v = g
d.y = b
d.x = b
d.w = n
d.q = g
d.u = a
j.x = m
j.v = g
b.s = m
b.v = g
b.x = g
b.w = j
b.o = n
m.y = b
m.x = b
m.w = h
m.q = g
m.u = j
h.v = g
h.x = c
assert j.x.u.x.w.x.s.w.x.txt == "c"