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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: D = None
        self.q: A = None
        self.w: A = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
n = C("n")
k = D("k")
b = E("b")
a = F("a")
m = G("m")
g = H("g")
h = I("h")

l.s = g
l.r = g
l.q = h
l.x = i
l.t = a
l.y = n
i.p = g
i.s = k
n.u = k
k.y = g
k.z = n
k.o = m
k.w = b
b.q = a
a.v = n
a.r = k
a.q = l
a.w = l
m.w = i
g.t = h
g.v = b
h.s = k
assert k.y.t.s.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: I = None
        self.x: B = None
        self.r: H = None
        self.t: F = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: D = None
        self.q: A = None
        self.w: A = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
n = C("n")
k = D("k")
b = E("b")
a = F("a")
m = G("m")
g = H("g")
h = I("h")

l.s = g
l.r = g
l.q = h
l.x = i
l.t = a
l.y = n
i.p = g
i.s = k
n.u = k
k.y = g
k.z = n
k.o = m
k.w = b
b.q = a
a.v = n
a.r = k
a.q = l
a.w = l
m.w = i
g.t = h
g.v = b
h.s = k
assert k.y.t.s.w.q.txt == "a"