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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

k = A("k")
e = B("e")
f = C("f")
a = D("a")
c = E("c")
l = E("l")
d = C("d")
m = A("m")

k.x = f
k.v = c
k.o = e
e.r = a
f.q = a
f.y = k
f.r = e
a.x = d
c.u = f
c.q = f
l.u = d
l.q = f
d.q = a
d.y = m
d.r = e
m.x = f
m.v = c
m.o = e
assert k.v.q.y.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

k = A("k")
e = B("e")
f = C("f")
a = D("a")
c = E("c")
l = E("l")
d = C("d")
m = A("m")

k.x = f
k.v = c
k.o = e
e.r = a
f.q = a
f.y = k
f.r = e
a.x = d
c.u = f
c.q = f
l.u = d
l.q = f
d.q = a
d.y = m
d.r = e
m.x = f
m.v = c
m.o = e
assert k.v.q.y.o.r.txt == "a"