class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: D = None
        self.s: I = None
        self.r: E = None
        self.q: F = None
        self.p: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: E = None
        self.w: H = None
        self.r: G = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: E = None
        self.w: H = None
        self.r: G = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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