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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: C = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: J = None
        self.z: C = None
        self.w: C = None
        self.u: D = None
        self.x: I = None
        self.t: E = None
        self.q: D = None
        self.r: G = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: D = None
        self.x: E = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: C = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: J = None
        self.z: C = None
        self.w: C = None
        self.u: D = None
        self.x: I = None
        self.t: E = None
        self.q: D = None
        self.r: G = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: D = None
        self.x: E = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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