class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: B = None
        self.x: B = None
        self.p: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: D = None
        self.t: H = None
        self.q: F = None
        self.x: G = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.w: B = None
        self.r: B = None
        self.t: C = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: F = None
        self.u: I = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

l = A("l")
n = B("n")
i = C("i")
k = D("k")
b = E("b")
d = F("d")
h = G("h")
f = H("f")
j = I("j")

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: D = None
        self.t: H = None
        self.q: F = None
        self.x: G = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.w: B = None
        self.r: B = None
        self.t: C = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: F = None
        self.u: I = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

l = A("l")
n = B("n")
i = C("i")
k = D("k")
b = E("b")
d = F("d")
h = G("h")
f = H("f")
j = I("j")

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