class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: E = None
        self.r: I = None
        self.t: H = None
        self.q: A = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.x: A = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: E = None
        self.r: I = None
        self.t: H = None
        self.q: A = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.x: A = None
        self.s: D = None
        self.txt = txt

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

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

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