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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.txt = txt

k = A("k")
i = B("i")
j = C("j")
l = D("l")
a = E("a")
e = A("e")
f = D("f")

k.y = i
i.r = f
i.x = f
i.y = j
j.s = k
j.v = e
l.u = a
l.v = i
l.t = i
a.p = e
a.y = e
e.y = i
f.u = a
f.v = i
f.t = i
assert k.y.x.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.txt = txt

k = A("k")
i = B("i")
j = C("j")
l = D("l")
a = E("a")
e = A("e")
f = D("f")

k.y = i
i.r = f
i.x = f
i.y = j
j.s = k
j.v = e
l.u = a
l.v = i
l.t = i
a.p = e
a.y = e
e.y = i
f.u = a
f.v = i
f.t = i
assert k.y.x.t.y.txt == "j"