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

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

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

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

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

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

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

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

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

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

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

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

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