class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: F = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: F = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: I = None
        self.o: G = None
        self.t: E = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: F = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: I = None
        self.o: G = None
        self.t: E = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

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

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

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

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