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

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

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

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

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

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

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

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

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

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

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

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

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