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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.z: A = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.z: A = None
        self.r: B = None
        self.txt = txt

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

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

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

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