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

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

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

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

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

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

e.y = h
c.o = e
c.x = e
c.y = g
c.t = g
n.r = c
n.o = c
n.q = g
i.p = g
i.u = c
a.v = e
a.p = e
a.o = h
a.s = c
a.u = c
h.v = e
h.p = e
h.o = a
h.s = c
h.u = c
g.p = i
g.u = c
assert c.x.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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