class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: C = None
        self.t: I = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.x: B = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: H = None
        self.q: C = None
        self.p: A = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.x: B = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: H = None
        self.q: C = None
        self.p: A = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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