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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: G = None
        self.y: H = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.w: B = None
        self.x: I = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: J = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

b = A("b")
n = B("n")
k = C("k")
l = D("l")
g = E("g")
c = F("c")
h = G("h")
a = H("a")
i = I("i")
f = J("f")

b.u = k
n.z = c
k.w = g
k.x = g
k.s = h
k.r = l
l.y = b
l.q = i
g.x = i
g.r = h
g.y = a
g.u = n
c.y = k
c.u = k
c.s = b
c.w = n
c.x = i
h.v = g
a.x = c
a.z = b
i.y = l
i.q = f
i.x = k
f.y = k
assert c.u.s.v.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: G = None
        self.y: H = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.w: B = None
        self.x: I = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: J = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

b = A("b")
n = B("n")
k = C("k")
l = D("l")
g = E("g")
c = F("c")
h = G("h")
a = H("a")
i = I("i")
f = J("f")

b.u = k
n.z = c
k.w = g
k.x = g
k.s = h
k.r = l
l.y = b
l.q = i
g.x = i
g.r = h
g.y = a
g.u = n
c.y = k
c.u = k
c.s = b
c.w = n
c.x = i
h.v = g
a.x = c
a.z = b
i.y = l
i.q = f
i.x = k
f.y = k
assert c.u.s.v.u.z.txt == "c"