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

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

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

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

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

b = A("b")
f = B("f")
l = C("l")
e = D("e")
n = E("n")
h = B("h")
m = C("m")
k = E("k")
i = D("i")

b.q = i
b.w = i
b.o = h
f.y = h
f.v = l
f.r = n
f.t = i
f.x = m
l.w = f
l.u = e
l.p = e
l.v = i
e.r = k
e.w = i
e.t = h
e.s = b
n.r = e
n.p = h
n.o = h
n.z = k
n.v = f
h.y = f
h.v = m
h.x = m
h.r = k
h.t = i
m.w = f
m.u = e
m.v = i
m.p = i
k.r = i
k.p = f
k.z = n
k.v = h
k.o = h
i.r = k
i.w = e
i.t = f
i.s = b
assert f.y.r.z.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

b = A("b")
f = B("f")
l = C("l")
e = D("e")
n = E("n")
h = B("h")
m = C("m")
k = E("k")
i = D("i")

b.q = i
b.w = i
b.o = h
f.y = h
f.v = l
f.r = n
f.t = i
f.x = m
l.w = f
l.u = e
l.p = e
l.v = i
e.r = k
e.w = i
e.t = h
e.s = b
n.r = e
n.p = h
n.o = h
n.z = k
n.v = f
h.y = f
h.v = m
h.x = m
h.r = k
h.t = i
m.w = f
m.u = e
m.v = i
m.p = i
k.r = i
k.p = f
k.z = n
k.v = h
k.o = h
i.r = k
i.w = e
i.t = f
i.s = b
assert f.y.r.z.p.t.txt == "i"