class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.p: F = None
        self.s: F = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: A = None
        self.o: A = None
        self.r: C = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: H = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: I = None
        self.t: B = None
        self.s: D = None
        self.p: G = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.s: A = None
        self.r: F = None
        self.txt = txt

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

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

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

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

b.v = m
b.q = a
b.p = e
b.s = e
b.w = e
b.u = f
m.y = c
m.t = b
m.o = b
m.x = b
m.r = a
a.r = m
a.p = k
a.o = i
g.v = i
g.p = f
f.v = k
f.x = l
f.t = m
f.w = m
f.s = g
f.p = i
f.y = a
e.s = f
i.p = f
i.z = m
i.s = b
i.r = e
k.y = a
k.q = l
k.o = b
k.w = b
k.p = m
k.v = i
k.z = f
l.x = m
c.w = l
c.x = i
c.v = e
assert a.o.s.s.s.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.p: F = None
        self.s: F = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: A = None
        self.o: A = None
        self.r: C = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: H = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: I = None
        self.t: B = None
        self.s: D = None
        self.p: G = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.s: A = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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