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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: H = None
        self.y: F = None
        self.x: F = None
        self.t: H = None
        self.q: A = None
        self.o: B = None
        self.r: A = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: B = None
        self.r: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: J = None
        self.o: F = None
        self.s: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: I = None
        self.p: J = None
        self.u: E = None
        self.s: E = None
        self.o: J = None
        self.y: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: H = None
        self.y: F = None
        self.x: F = None
        self.t: H = None
        self.q: A = None
        self.o: B = None
        self.r: A = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: B = None
        self.r: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: J = None
        self.o: F = None
        self.s: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: I = None
        self.p: J = None
        self.u: E = None
        self.s: E = None
        self.o: J = None
        self.y: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.w: G = None
        self.txt = txt

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

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