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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: G = None
        self.x: A = None
        self.o: A = None
        self.r: A = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: H = None
        self.x: D = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: H = None
        self.z: E = None
        self.v: C = None
        self.q: A = None
        self.t: F = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: G = None
        self.s: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: G = None
        self.x: A = None
        self.o: A = None
        self.r: A = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: H = None
        self.x: D = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: H = None
        self.z: E = None
        self.v: C = None
        self.q: A = None
        self.t: F = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: G = None
        self.s: B = None
        self.v: B = None
        self.txt = txt

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

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

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