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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: D = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: B = None
        self.w: G = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.y: G = None
        self.w: G = None
        self.txt = txt

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

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

g = A("g")
k = B("k")
n = C("n")
e = D("e")
b = E("b")
c = F("c")
i = G("i")
h = G("h")
a = F("a")

g.t = n
g.o = n
g.z = n
g.s = k
k.y = h
k.t = e
k.u = g
k.v = n
n.o = i
n.w = i
n.u = k
n.q = c
e.w = g
b.q = e
b.v = n
b.y = h
b.w = i
c.y = b
i.s = n
i.u = e
h.s = n
h.u = e
a.y = b
assert n.q.y.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: D = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: B = None
        self.w: G = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.y: G = None
        self.w: G = None
        self.txt = txt

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

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

g = A("g")
k = B("k")
n = C("n")
e = D("e")
b = E("b")
c = F("c")
i = G("i")
h = G("h")
a = F("a")

g.t = n
g.o = n
g.z = n
g.s = k
k.y = h
k.t = e
k.u = g
k.v = n
n.o = i
n.w = i
n.u = k
n.q = c
e.w = g
b.q = e
b.v = n
b.y = h
b.w = i
c.y = b
i.s = n
i.u = e
h.s = n
h.u = e
a.y = b
assert n.q.y.q.w.txt == "g"