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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: E = None
        self.s: E = None
        self.p: I = None
        self.v: F = None
        self.w: F = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: H = None
        self.s: F = None
        self.w: G = None
        self.u: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: C = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.w: I = None
        self.y: E = None
        self.q: H = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.q: G = None
        self.s: J = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: I = None
        self.z: B = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: E = None
        self.s: E = None
        self.p: I = None
        self.v: F = None
        self.w: F = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: H = None
        self.s: F = None
        self.w: G = None
        self.u: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: C = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.w: I = None
        self.y: E = None
        self.q: H = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.q: G = None
        self.s: J = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: I = None
        self.z: B = None
        self.p: B = None
        self.txt = txt

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

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