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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: I = None
        self.z: F = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

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

l.w = i
l.r = a
i.u = f
i.x = g
i.v = l
h.y = l
h.w = l
h.p = f
h.z = e
a.r = g
a.s = d
a.y = d
a.v = e
a.q = f
a.x = i
a.u = b
a.t = h
a.p = l
g.p = l
g.q = d
e.u = f
e.o = f
e.t = f
e.y = g
b.x = h
b.v = f
b.p = f
b.t = l
b.o = e
d.x = h
d.s = h
d.y = g
f.p = d
f.w = d
f.z = e
f.v = e
f.o = e
f.r = a
f.t = b
f.u = h
assert f.o.y.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: I = None
        self.z: F = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

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

l.w = i
l.r = a
i.u = f
i.x = g
i.v = l
h.y = l
h.w = l
h.p = f
h.z = e
a.r = g
a.s = d
a.y = d
a.v = e
a.q = f
a.x = i
a.u = b
a.t = h
a.p = l
g.p = l
g.q = d
e.u = f
e.o = f
e.t = f
e.y = g
b.x = h
b.v = f
b.p = f
b.t = l
b.o = e
d.x = h
d.s = h
d.y = g
f.p = d
f.w = d
f.z = e
f.v = e
f.o = e
f.r = a
f.t = b
f.u = h
assert f.o.y.p.w.txt == "i"