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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: J = None
        self.q: I = None
        self.u: D = None
        self.o: J = None
        self.x: A = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: I = None
        self.z: B = None
        self.y: G = None
        self.p: J = None
        self.r: J = None
        self.o: J = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: C = None
        self.w: G = None
        self.p: B = None
        self.r: B = None
        self.z: G = None
        self.q: C = None
        self.u: A = None
        self.o: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: J = None
        self.q: I = None
        self.u: D = None
        self.o: J = None
        self.x: A = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: I = None
        self.z: B = None
        self.y: G = None
        self.p: J = None
        self.r: J = None
        self.o: J = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: C = None
        self.w: G = None
        self.p: B = None
        self.r: B = None
        self.z: G = None
        self.q: C = None
        self.u: A = None
        self.o: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: A = None
        self.txt = txt

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

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