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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: E = None
        self.t: E = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

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

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

f = A("f")
a = B("a")
c = C("c")
k = D("k")
g = E("g")
i = B("i")

f.v = i
f.y = a
f.u = g
a.o = c
a.x = k
c.s = k
c.p = k
c.w = k
c.u = g
c.t = g
k.q = f
g.v = f
g.z = c
i.o = c
i.x = k
assert i.x.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: E = None
        self.t: E = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

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

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

f = A("f")
a = B("a")
c = C("c")
k = D("k")
g = E("g")
i = B("i")

f.v = i
f.y = a
f.u = g
a.o = c
a.x = k
c.s = k
c.p = k
c.w = k
c.u = g
c.t = g
k.q = f
g.v = f
g.z = c
i.o = c
i.x = k
assert i.x.q.u.txt == "g"