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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

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

f = A("f")
a = B("a")
j = C("j")
i = D("i")
b = E("b")
l = C("l")
n = A("n")

f.o = b
f.v = b
f.u = n
a.y = b
a.v = b
a.u = i
j.z = l
j.o = a
j.p = f
j.w = f
i.u = j
i.o = a
i.z = a
b.x = a
b.t = a
b.v = a
b.y = n
b.w = j
l.z = j
l.o = a
l.p = n
l.w = f
n.o = b
n.v = b
n.u = f
assert i.o.u.o.u.u.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

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

f = A("f")
a = B("a")
j = C("j")
i = D("i")
b = E("b")
l = C("l")
n = A("n")

f.o = b
f.v = b
f.u = n
a.y = b
a.v = b
a.u = i
j.z = l
j.o = a
j.p = f
j.w = f
i.u = j
i.o = a
i.z = a
b.x = a
b.t = a
b.v = a
b.y = n
b.w = j
l.z = j
l.o = a
l.p = n
l.w = f
n.o = b
n.v = b
n.u = f
assert i.o.u.o.u.u.o.v.txt == "b"