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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: D = None
        self.p: D = None
        self.x: I = None
        self.q: I = None
        self.w: F = None
        self.r: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: D = None
        self.p: D = None
        self.x: I = None
        self.q: I = None
        self.w: F = None
        self.r: I = None
        self.txt = txt

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

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

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

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