class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.t: B = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

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

l = A("l")
a = B("a")
g = C("g")
n = D("n")
m = E("m")

l.z = m
l.p = n
l.x = n
l.t = a
l.q = a
a.r = n
a.q = l
a.s = g
a.y = g
g.u = n
g.q = n
g.t = n
g.v = m
g.y = m
n.v = m
n.o = l
m.w = a
m.q = a
m.z = a
m.o = g
assert a.s.y.o.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.t: B = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

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

l = A("l")
a = B("a")
g = C("g")
n = D("n")
m = E("m")

l.z = m
l.p = n
l.x = n
l.t = a
l.q = a
a.r = n
a.q = l
a.s = g
a.y = g
g.u = n
g.q = n
g.t = n
g.v = m
g.y = m
n.v = m
n.o = l
m.w = a
m.q = a
m.z = a
m.o = g
assert a.s.y.o.v.o.txt == "g"