class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: B = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

g = A("g")
h = B("h")
c = C("c")
i = D("i")
e = E("e")
a = A("a")
m = E("m")
l = B("l")
b = E("b")
d = B("d")

g.s = a
g.o = a
g.z = h
g.r = e
h.u = c
h.t = c
h.w = l
c.z = h
c.x = a
c.t = i
c.u = g
i.x = h
e.y = m
e.o = i
a.s = g
a.o = g
a.z = l
a.r = m
m.y = e
m.o = i
l.u = c
l.t = c
l.w = h
b.y = e
b.o = i
d.u = c
d.t = c
d.w = h
assert a.s.o.s.z.w.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: B = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

g = A("g")
h = B("h")
c = C("c")
i = D("i")
e = E("e")
a = A("a")
m = E("m")
l = B("l")
b = E("b")
d = B("d")

g.s = a
g.o = a
g.z = h
g.r = e
h.u = c
h.t = c
h.w = l
c.z = h
c.x = a
c.t = i
c.u = g
i.x = h
e.y = m
e.o = i
a.s = g
a.o = g
a.z = l
a.r = m
m.y = e
m.o = i
l.u = c
l.t = c
l.w = h
b.y = e
b.o = i
d.u = c
d.t = c
d.w = h
assert a.s.o.s.z.w.u.x.txt == "a"