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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: H = None
        self.t: F = None
        self.r: I = None
        self.u: G = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: A = None
        self.t: J = None
        self.y: F = None
        self.p: H = None
        self.o: F = None
        self.w: A = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.s: J = None
        self.t: J = None
        self.y: A = None
        self.w: G = None
        self.u: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.w: C = None
        self.x: B = None
        self.s: A = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: D = None
        self.w: G = None
        self.t: B = None
        self.txt = txt

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

j.q = e
j.w = b
j.v = b
j.p = b
j.u = a
j.o = a
j.x = a
j.z = f
j.y = m
j.t = l
a.u = d
f.s = e
f.w = l
f.t = g
f.r = c
f.u = b
f.o = j
e.y = b
e.u = l
d.r = f
d.s = l
g.z = j
b.x = g
b.y = g
b.o = g
b.z = j
b.w = j
b.q = j
b.t = m
b.p = l
b.v = d
l.r = e
l.z = a
l.s = m
l.t = m
l.u = m
l.y = j
l.w = b
c.t = e
c.o = f
c.w = f
c.r = f
c.x = a
c.s = j
m.v = l
m.u = e
m.w = b
m.t = a
assert g.z.t.y.z.o.y.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: G = None
        self.v: G = None
        self.u: B = None
        self.z: C = None
        self.y: J = None
        self.o: B = None
        self.t: H = None
        self.p: G = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: H = None
        self.t: F = None
        self.r: I = None
        self.u: G = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: A = None
        self.t: J = None
        self.y: F = None
        self.p: H = None
        self.o: F = None
        self.w: A = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.s: J = None
        self.t: J = None
        self.y: A = None
        self.w: G = None
        self.u: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.w: C = None
        self.x: B = None
        self.s: A = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: D = None
        self.w: G = None
        self.t: B = None
        self.txt = txt

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

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