class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: G = None
        self.z: I = None
        self.y: H = None
        self.u: G = None
        self.s: G = None
        self.x: E = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: A = None
        self.x: B = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.w: A = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: H = None
        self.z: D = None
        self.p: A = None
        self.u: H = None
        self.s: A = None
        self.o: C = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: G = None
        self.z: I = None
        self.y: H = None
        self.u: G = None
        self.s: G = None
        self.x: E = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: A = None
        self.x: B = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.w: A = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: H = None
        self.z: D = None
        self.p: A = None
        self.u: H = None
        self.s: A = None
        self.o: C = None
        self.y: A = None
        self.txt = txt

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

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