class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.z: F = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: B = None
        self.q: G = None
        self.w: A = None
        self.v: F = None
        self.o: E = None
        self.x: I = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: J = None
        self.v: B = None
        self.p: C = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: H = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: F = None
        self.r: J = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.u: D = None
        self.y: H = None
        self.q: E = None
        self.z: I = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: B = None
        self.q: G = None
        self.w: A = None
        self.v: F = None
        self.o: E = None
        self.x: I = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: J = None
        self.v: B = None
        self.p: C = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: H = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: F = None
        self.r: J = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.u: D = None
        self.y: H = None
        self.q: E = None
        self.z: I = None
        self.w: D = None
        self.txt = txt

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

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