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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: A = None
        self.u: B = None
        self.s: H = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: B = None
        self.y: I = None
        self.v: H = None
        self.o: H = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: A = None
        self.p: G = None
        self.txt = txt

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

f = A("f")
i = B("i")
c = C("c")
l = D("l")
g = E("g")
a = F("a")
k = G("k")
b = H("b")
h = I("h")

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: A = None
        self.u: B = None
        self.s: H = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: B = None
        self.y: I = None
        self.v: H = None
        self.o: H = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: A = None
        self.p: G = None
        self.txt = txt

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

f = A("f")
i = B("i")
c = C("c")
l = D("l")
g = E("g")
a = F("a")
k = G("k")
b = H("b")
h = I("h")

f.o = i
i.q = b
i.p = k
i.t = k
c.x = i
l.p = i
l.u = i
l.q = f
l.s = b
l.r = c
g.t = l
g.z = i
g.q = i
g.y = h
g.v = b
g.o = b
a.u = h
a.y = k
k.o = h
b.w = k
b.p = k
b.r = f
h.o = f
assert a.y.o.o.txt == "f"