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

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

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

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

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

n = A("n")
l = B("l")
i = C("i")
j = D("j")
f = E("f")
c = D("c")
b = E("b")

n.q = j
n.z = l
l.o = n
l.p = c
l.t = c
l.q = f
i.q = n
i.v = f
i.p = l
i.t = l
j.r = f
j.x = l
j.w = n
j.v = c
j.p = b
f.z = b
c.r = f
c.p = f
c.x = l
c.w = n
c.v = j
b.z = f
assert i.v.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: B = None
        self.txt = txt

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

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

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

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

n = A("n")
l = B("l")
i = C("i")
j = D("j")
f = E("f")
c = D("c")
b = E("b")

n.q = j
n.z = l
l.o = n
l.p = c
l.t = c
l.q = f
i.q = n
i.v = f
i.p = l
i.t = l
j.r = f
j.x = l
j.w = n
j.v = c
j.p = b
f.z = b
c.r = f
c.p = f
c.x = l
c.w = n
c.v = j
b.z = f
assert i.v.z.z.z.txt == "b"