class A:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: I = None
        self.t: I = None
        self.z: J = None
        self.v: H = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: A = None
        self.v: A = None
        self.x: H = None
        self.u: H = None
        self.p: F = None
        self.w: G = None
        self.y: B = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.q: J = None
        self.u: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: I = None
        self.z: J = None
        self.q: C = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: A = None
        self.p: A = None
        self.q: B = None
        self.x: J = None
        self.u: G = None
        self.t: G = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: I = None
        self.t: I = None
        self.z: J = None
        self.v: H = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: A = None
        self.v: A = None
        self.x: H = None
        self.u: H = None
        self.p: F = None
        self.w: G = None
        self.y: B = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.q: J = None
        self.u: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: I = None
        self.z: J = None
        self.q: C = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: A = None
        self.p: A = None
        self.q: B = None
        self.x: J = None
        self.u: G = None
        self.t: G = None
        self.v: D = None
        self.txt = txt

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

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

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