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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: G = None
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.x: B = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.v: C = None
        self.q: E = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

k = A("k")
g = B("g")
i = C("i")
b = D("b")
f = E("f")
a = F("a")
n = G("n")
h = F("h")
d = D("d")
j = F("j")

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: G = None
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.x: B = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.v: C = None
        self.q: E = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

k = A("k")
g = B("g")
i = C("i")
b = D("b")
f = E("f")
a = F("a")
n = G("n")
h = F("h")
d = D("d")
j = F("j")

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