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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: E = None
        self.s: I = None
        self.u: J = None
        self.w: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: A = None
        self.y: A = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: H = None
        self.s: J = None
        self.t: A = None
        self.r: F = None
        self.p: B = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: I = None
        self.s: C = None
        self.z: I = None
        self.q: E = None
        self.t: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: J = None
        self.v: I = None
        self.o: C = None
        self.q: J = None
        self.y: I = None
        self.s: E = None
        self.z: C = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: I = None
        self.r: D = None
        self.v: E = None
        self.p: I = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: E = None
        self.s: I = None
        self.u: J = None
        self.w: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: A = None
        self.y: A = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: H = None
        self.s: J = None
        self.t: A = None
        self.r: F = None
        self.p: B = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: I = None
        self.s: C = None
        self.z: I = None
        self.q: E = None
        self.t: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: J = None
        self.v: I = None
        self.o: C = None
        self.q: J = None
        self.y: I = None
        self.s: E = None
        self.z: C = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: I = None
        self.r: D = None
        self.v: E = None
        self.p: I = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

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

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

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