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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: I = None
        self.txt = txt

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

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

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

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