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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.u: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

l = A("l")
h = B("h")
k = C("k")
d = D("d")
a = E("a")
i = C("i")
f = A("f")

l.t = f
l.r = a
l.v = k
h.z = f
h.t = f
h.x = a
k.q = f
k.w = f
k.x = f
k.u = d
k.t = d
d.u = l
d.r = l
d.w = h
a.y = d
a.o = l
i.q = l
i.w = l
i.u = d
i.t = d
i.x = f
f.t = l
f.r = a
f.v = i
assert f.v.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.u: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

l = A("l")
h = B("h")
k = C("k")
d = D("d")
a = E("a")
i = C("i")
f = A("f")

l.t = f
l.r = a
l.v = k
h.z = f
h.t = f
h.x = a
k.q = f
k.w = f
k.x = f
k.u = d
k.t = d
d.u = l
d.r = l
d.w = h
a.y = d
a.o = l
i.q = l
i.w = l
i.u = d
i.t = d
i.x = f
f.t = l
f.r = a
f.v = i
assert f.v.w.v.txt == "k"