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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: C = None
        self.txt = txt

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

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

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