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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: G = None
        self.o: I = None
        self.r: D = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: E = None
        self.q: E = None
        self.r: C = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: G = None
        self.o: I = None
        self.r: D = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: E = None
        self.q: E = None
        self.r: C = None
        self.p: F = None
        self.txt = txt

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

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

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