class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: J = None
        self.w: J = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: E = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: G = None
        self.y: I = None
        self.z: F = None
        self.q: G = None
        self.x: A = None
        self.t: J = None
        self.p: D = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
n = C("n")
j = D("j")
g = E("g")
a = F("a")
d = G("d")
c = H("c")
e = I("e")
i = J("i")

l.r = j
l.s = i
l.w = i
l.t = k
k.w = a
k.t = g
k.p = j
n.x = j
n.y = c
j.p = c
g.x = c
g.p = a
g.z = i
a.v = i
a.s = d
d.r = i
d.s = i
d.q = g
d.t = g
d.o = l
d.w = l
d.z = l
d.x = n
d.p = n
d.v = j
c.r = a
c.z = a
c.s = d
c.q = d
c.y = e
c.x = l
c.t = i
c.p = j
e.s = i
e.t = a
e.v = n
i.q = l
i.z = l
i.w = g
i.y = g
i.p = j
i.v = d
i.o = n
i.r = e
assert d.r.z.r.p.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: J = None
        self.w: J = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: E = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: G = None
        self.y: I = None
        self.z: F = None
        self.q: G = None
        self.x: A = None
        self.t: J = None
        self.p: D = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
n = C("n")
j = D("j")
g = E("g")
a = F("a")
d = G("d")
c = H("c")
e = I("e")
i = J("i")

l.r = j
l.s = i
l.w = i
l.t = k
k.w = a
k.t = g
k.p = j
n.x = j
n.y = c
j.p = c
g.x = c
g.p = a
g.z = i
a.v = i
a.s = d
d.r = i
d.s = i
d.q = g
d.t = g
d.o = l
d.w = l
d.z = l
d.x = n
d.p = n
d.v = j
c.r = a
c.z = a
c.s = d
c.q = d
c.y = e
c.x = l
c.t = i
c.p = j
e.s = i
e.t = a
e.v = n
i.q = l
i.z = l
i.w = g
i.y = g
i.p = j
i.v = d
i.o = n
i.r = e
assert d.r.z.r.p.y.s.txt == "i"