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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.s: H = None
        self.v: I = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.s: H = None
        self.v: I = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

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

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

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