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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: G = None
        self.y: D = None
        self.u: A = None
        self.v: C = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.o: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: G = None
        self.y: D = None
        self.u: A = None
        self.v: C = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.o: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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