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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: I = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: G = None
        self.t: A = None
        self.p: I = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: A = None
        self.u: C = None
        self.q: E = None
        self.y: B = None
        self.p: E = None
        self.v: D = None
        self.o: F = None
        self.t: I = None
        self.txt = txt

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

e = A("e")
a = B("a")
c = C("c")
g = D("g")
h = E("h")
m = F("m")
j = G("j")
d = H("d")
b = I("b")
f = A("f")

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: I = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: G = None
        self.t: A = None
        self.p: I = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: A = None
        self.u: C = None
        self.q: E = None
        self.y: B = None
        self.p: E = None
        self.v: D = None
        self.o: F = None
        self.t: I = None
        self.txt = txt

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

e = A("e")
a = B("a")
c = C("c")
g = D("g")
h = E("h")
m = F("m")
j = G("j")
d = H("d")
b = I("b")
f = A("f")

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