class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: E = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.r: E = None
        self.o: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: A = None
        self.v: B = None
        self.w: A = None
        self.x: D = None
        self.o: B = None
        self.q: J = None
        self.s: A = None
        self.r: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: F = None
        self.w: A = None
        self.y: G = None
        self.o: H = None
        self.u: H = None
        self.p: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.txt = txt

a = A("a")
f = B("f")
g = C("g")
c = D("c")
l = E("l")
d = F("d")
i = G("i")
k = H("k")
h = I("h")
b = J("b")

a.q = d
a.w = l
a.r = c
a.v = c
f.u = l
f.w = h
g.z = d
g.u = i
g.r = l
g.o = h
c.p = l
c.y = f
c.w = f
c.t = f
c.r = i
c.s = k
c.v = k
l.x = h
l.v = a
d.q = h
i.p = h
i.u = a
i.w = a
i.s = a
i.v = f
i.o = f
i.x = c
i.q = b
i.r = l
k.u = l
h.s = k
h.o = k
h.u = k
h.q = d
h.w = a
h.y = i
h.p = l
b.x = g
b.p = d
assert a.w.v.r.w.w.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: E = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.r: E = None
        self.o: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: A = None
        self.v: B = None
        self.w: A = None
        self.x: D = None
        self.o: B = None
        self.q: J = None
        self.s: A = None
        self.r: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: F = None
        self.w: A = None
        self.y: G = None
        self.o: H = None
        self.u: H = None
        self.p: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.txt = txt

a = A("a")
f = B("f")
g = C("g")
c = D("c")
l = E("l")
d = F("d")
i = G("i")
k = H("k")
h = I("h")
b = J("b")

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