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

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

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

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

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

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

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

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

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

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

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

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

i.v = j
i.s = b
i.t = h
i.r = a
b.z = a
b.v = n
h.p = n
h.y = a
h.o = a
h.q = j
h.z = b
n.q = b
n.x = b
n.y = h
n.v = i
n.o = i
j.w = b
j.r = i
j.v = h
j.t = n
a.w = b
a.r = i
a.v = h
a.t = n
assert j.v.p.y.p.txt == "n"