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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: A = None
        self.s: D = None
        self.o: E = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: H = None
        self.r: B = None
        self.q: H = None
        self.o: H = None
        self.w: F = None
        self.z: G = None
        self.s: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.r: E = None
        self.w: C = None
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: C = None
        self.y: E = None
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: A = None
        self.s: D = None
        self.o: E = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: H = None
        self.r: B = None
        self.q: H = None
        self.o: H = None
        self.w: F = None
        self.z: G = None
        self.s: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.r: E = None
        self.w: C = None
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: C = None
        self.y: E = None
        self.r: A = None
        self.txt = txt

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

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