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

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

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

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

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

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

h.y = e
h.u = e
h.r = c
h.t = a
h.w = n
e.p = d
e.w = h
e.t = h
e.q = a
e.s = c
n.s = d
n.p = e
a.u = e
a.w = n
c.w = e
d.s = n
d.p = e
assert c.w.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: E = None
        self.t: D = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

h.y = e
h.u = e
h.r = c
h.t = a
h.w = n
e.p = d
e.w = h
e.t = h
e.q = a
e.s = c
n.s = d
n.p = e
a.u = e
a.w = n
c.w = e
d.s = n
d.p = e
assert c.w.t.t.txt == "a"