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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.t: E = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.t: C = None
        self.r: E = None
        self.p: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.t: E = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.t: C = None
        self.r: E = None
        self.p: A = None
        self.txt = txt

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

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

e.x = g
e.r = g
e.q = m
e.y = c
c.q = g
c.p = g
c.v = i
c.t = i
c.o = a
g.s = i
g.p = e
a.v = g
a.t = g
a.u = e
a.p = e
a.r = i
i.s = e
i.y = e
i.q = e
i.x = a
i.w = a
m.v = g
m.t = g
m.u = e
m.p = e
m.r = i
assert e.y.o.p.txt == "e"