class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: H = None
        self.x: A = None
        self.v: F = None
        self.p: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: F = None
        self.y: E = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: B = None
        self.r: I = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: H = None
        self.x: A = None
        self.v: F = None
        self.p: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: F = None
        self.y: E = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: B = None
        self.r: I = None
        self.txt = txt

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

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

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