class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: G = None
        self.y: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: I = None
        self.s: H = None
        self.x: H = None
        self.v: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: G = None
        self.v: B = None
        self.u: G = None
        self.w: J = None
        self.q: B = None
        self.y: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: I = None
        self.s: H = None
        self.x: H = None
        self.v: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: G = None
        self.v: B = None
        self.u: G = None
        self.w: J = None
        self.q: B = None
        self.y: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: G = None
        self.z: C = None
        self.txt = txt

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

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

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