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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

h = A("h")
j = B("j")
l = C("l")
i = D("i")
e = E("e")
a = D("a")

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

h = A("h")
j = B("j")
l = C("l")
i = D("i")
e = E("e")
a = D("a")

h.s = e
h.r = e
h.t = j
h.o = l
h.p = i
j.q = h
l.r = a
l.s = j
i.u = a
i.o = j
i.x = j
i.s = h
i.y = e
e.v = j
e.x = i
e.t = i
e.y = a
a.u = i
a.o = j
a.x = j
a.s = h
a.y = e
assert j.q.t.q.o.txt == "l"