class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: A = None
        self.t: I = None
        self.o: G = None
        self.z: B = None
        self.r: D = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: A = None
        self.t: I = None
        self.o: G = None
        self.z: B = None
        self.r: D = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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