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

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

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

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

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

i = A("i")
h = B("h")
d = C("d")
n = D("n")
j = E("j")

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

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

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

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

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

i = A("i")
h = B("h")
d = C("d")
n = D("n")
j = E("j")

i.q = n
i.x = h
i.o = h
i.w = d
i.u = d
h.s = n
h.q = n
d.o = n
d.v = h
d.y = h
n.p = j
n.v = d
j.p = h
j.r = h
j.o = d
j.t = i
assert j.o.o.p.txt == "j"