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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: A = None
        self.s: F = None
        self.o: A = None
        self.r: F = None
        self.x: C = None
        self.v: G = None
        self.txt = txt

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

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

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

e = A("e")
g = B("g")
n = C("n")
b = D("b")
m = E("m")
j = F("j")
h = G("h")
i = C("i")
d = A("d")

e.w = d
e.z = b
e.y = g
e.u = i
e.x = i
g.v = h
n.u = h
n.r = j
b.u = m
b.w = e
b.o = e
b.s = j
b.r = j
b.x = i
b.v = h
m.y = h
j.x = i
j.z = i
j.y = g
j.s = e
j.q = n
h.v = g
h.q = j
i.u = h
i.r = j
d.w = e
d.z = b
d.y = g
d.u = n
d.x = n
assert g.v.q.y.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: D = None
        self.y: B = None
        self.u: C = None
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: A = None
        self.s: F = None
        self.o: A = None
        self.r: F = None
        self.x: C = None
        self.v: G = None
        self.txt = txt

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

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

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

e = A("e")
g = B("g")
n = C("n")
b = D("b")
m = E("m")
j = F("j")
h = G("h")
i = C("i")
d = A("d")

e.w = d
e.z = b
e.y = g
e.u = i
e.x = i
g.v = h
n.u = h
n.r = j
b.u = m
b.w = e
b.o = e
b.s = j
b.r = j
b.x = i
b.v = h
m.y = h
j.x = i
j.z = i
j.y = g
j.s = e
j.q = n
h.v = g
h.q = j
i.u = h
i.r = j
d.w = e
d.z = b
d.y = g
d.u = n
d.x = n
assert g.v.q.y.v.v.v.txt == "h"