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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: E = None
        self.s: B = None
        self.p: C = None
        self.w: B = None
        self.txt = txt

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

l = A("l")
k = B("k")
j = C("j")
n = D("n")
f = E("f")
h = B("h")

l.v = j
l.o = n
k.y = j
k.r = f
k.v = f
k.z = n
j.y = h
j.t = l
j.r = k
j.p = n
n.x = f
n.o = f
n.s = h
n.p = j
n.w = k
f.s = h
h.y = j
h.r = f
h.v = f
h.z = n
assert k.y.p.p.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: E = None
        self.s: B = None
        self.p: C = None
        self.w: B = None
        self.txt = txt

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

l = A("l")
k = B("k")
j = C("j")
n = D("n")
f = E("f")
h = B("h")

l.v = j
l.o = n
k.y = j
k.r = f
k.v = f
k.z = n
j.y = h
j.t = l
j.r = k
j.p = n
n.x = f
n.o = f
n.s = h
n.p = j
n.w = k
f.s = h
h.y = j
h.r = f
h.v = f
h.z = n
assert k.y.p.p.r.y.txt == "j"