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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.o: A = None
        self.w: E = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

d = A("d")
c = B("c")
h = C("h")
j = D("j")
b = E("b")

d.q = b
d.t = b
d.o = c
d.p = j
d.y = h
c.v = b
c.y = b
c.w = b
c.q = b
c.o = d
h.w = c
h.x = c
h.t = c
h.y = j
h.q = b
j.v = c
j.u = h
b.q = j
assert h.t.q.q.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.t: E = None
        self.p: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.o: A = None
        self.w: E = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

d = A("d")
c = B("c")
h = C("h")
j = D("j")
b = E("b")

d.q = b
d.t = b
d.o = c
d.p = j
d.y = h
c.v = b
c.y = b
c.w = b
c.q = b
c.o = d
h.w = c
h.x = c
h.t = c
h.y = j
h.q = b
j.v = c
j.u = h
b.q = j
assert h.t.q.q.v.o.txt == "d"