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

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

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

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

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

e = A("e")
j = B("j")
i = C("i")
g = D("g")
c = E("c")
a = E("a")

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

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

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

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

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

e = A("e")
j = B("j")
i = C("i")
g = D("g")
c = E("c")
a = E("a")

e.t = i
e.s = g
e.o = g
e.x = j
e.z = j
j.t = g
i.u = c
i.v = c
i.w = e
i.s = j
g.o = e
c.v = a
c.q = g
a.v = c
a.q = g
assert a.v.q.o.o.o.s.txt == "g"