class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.x: H = None
        self.z: D = None
        self.p: F = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.y: D = None
        self.w: G = None
        self.t: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.x: H = None
        self.z: D = None
        self.p: F = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.y: D = None
        self.w: G = None
        self.t: C = None
        self.txt = txt

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

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

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