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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

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