class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: C = None
        self.t: E = None
        self.r: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.r: F = None
        self.y: J = None
        self.u: E = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: I = None
        self.p: A = None
        self.y: B = None
        self.w: A = None
        self.v: C = None
        self.u: F = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: C = None
        self.t: E = None
        self.r: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.r: F = None
        self.y: J = None
        self.u: E = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: I = None
        self.p: A = None
        self.y: B = None
        self.w: A = None
        self.v: C = None
        self.u: F = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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