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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.txt = txt

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

g.u = f
g.s = j
g.t = k
g.y = c
f.s = g
f.r = g
f.u = j
c.p = k
c.z = k
c.v = j
k.v = g
k.t = f
k.q = c
k.u = c
j.s = c
j.x = c
assert c.v.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: E = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.txt = txt

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

g.u = f
g.s = j
g.t = k
g.y = c
f.s = g
f.r = g
f.u = j
c.p = k
c.z = k
c.v = j
k.v = g
k.t = f
k.q = c
k.u = c
j.s = c
j.x = c
assert c.v.x.z.txt == "k"