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

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

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

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

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

c = A("c")
g = B("g")
l = C("l")
h = D("h")
m = E("m")

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

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

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

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

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

c = A("c")
g = B("g")
l = C("l")
h = D("h")
m = E("m")

c.y = h
c.o = g
c.s = g
c.w = m
c.x = l
g.w = l
g.q = l
g.t = m
g.x = m
g.u = c
l.r = h
l.u = g
l.q = g
h.u = l
h.r = m
h.y = m
m.p = c
m.t = g
m.u = g
assert g.x.t.t.p.txt == "c"