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

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

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

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

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

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

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

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

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

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

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

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

f.u = a
a.s = f
a.t = i
a.o = e
j.p = b
j.y = f
j.v = f
j.s = e
j.z = i
b.z = f
b.u = f
b.x = f
b.y = e
b.v = i
e.q = f
e.x = b
i.s = f
i.t = a
i.o = e
assert e.x.x.u.txt == "a"