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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: F = None
        self.y: F = None
        self.s: A = None
        self.v: G = None
        self.o: G = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

c = A("c")
l = B("l")
b = C("b")
e = D("e")
h = E("h")
f = F("f")
n = G("n")
g = H("g")
m = B("m")
a = A("a")

c.z = e
c.y = b
l.q = g
l.p = f
l.y = f
l.s = a
l.v = n
l.o = n
l.r = m
l.z = b
b.o = n
b.v = m
b.q = e
e.r = h
e.s = f
e.y = n
e.v = m
e.q = g
e.t = a
e.p = c
h.y = b
h.q = b
h.v = f
f.r = a
f.w = e
n.z = e
n.u = g
n.s = b
n.t = b
n.w = a
g.v = n
m.q = g
m.p = f
m.y = f
m.s = c
m.v = n
m.o = n
m.r = l
m.z = b
a.z = e
a.y = b
assert g.v.z.y.t.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: F = None
        self.y: F = None
        self.s: A = None
        self.v: G = None
        self.o: G = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

c = A("c")
l = B("l")
b = C("b")
e = D("e")
h = E("h")
f = F("f")
n = G("n")
g = H("g")
m = B("m")
a = A("a")

c.z = e
c.y = b
l.q = g
l.p = f
l.y = f
l.s = a
l.v = n
l.o = n
l.r = m
l.z = b
b.o = n
b.v = m
b.q = e
e.r = h
e.s = f
e.y = n
e.v = m
e.q = g
e.t = a
e.p = c
h.y = b
h.q = b
h.v = f
f.r = a
f.w = e
n.z = e
n.u = g
n.s = b
n.t = b
n.w = a
g.v = n
m.q = g
m.p = f
m.y = f
m.s = c
m.v = n
m.o = n
m.r = l
m.z = b
a.z = e
a.y = b
assert g.v.z.y.t.v.q.txt == "g"