class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: A = None
        self.y: H = None
        self.t: B = None
        self.z: A = None
        self.s: B = None
        self.o: B = None
        self.r: J = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: H = None
        self.o: H = None
        self.t: G = None
        self.s: B = None
        self.q: I = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: A = None
        self.p: J = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: I = None
        self.u: J = None
        self.o: I = None
        self.x: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: H = None
        self.z: B = None
        self.r: D = None
        self.q: E = None
        self.t: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: A = None
        self.y: H = None
        self.t: B = None
        self.z: A = None
        self.s: B = None
        self.o: B = None
        self.r: J = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: H = None
        self.o: H = None
        self.t: G = None
        self.s: B = None
        self.q: I = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: A = None
        self.p: J = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: I = None
        self.u: J = None
        self.o: I = None
        self.x: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: H = None
        self.z: B = None
        self.r: D = None
        self.q: E = None
        self.t: H = None
        self.txt = txt

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

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

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