class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: E = None
        self.z: H = None
        self.q: D = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: I = None
        self.o: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: G = None
        self.u: A = None
        self.q: C = None
        self.v: E = None
        self.w: E = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.s: H = None
        self.y: F = None
        self.u: C = None
        self.o: C = None
        self.t: C = None
        self.x: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: E = None
        self.z: H = None
        self.q: D = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: I = None
        self.o: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: G = None
        self.u: A = None
        self.q: C = None
        self.v: E = None
        self.w: E = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.s: H = None
        self.y: F = None
        self.u: C = None
        self.o: C = None
        self.t: C = None
        self.x: H = None
        self.txt = txt

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

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