class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.u: E = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: F = None
        self.q: B = None
        self.z: F = None
        self.r: F = None
        self.y: B = None
        self.u: E = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: G = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.u: E = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: F = None
        self.q: B = None
        self.z: F = None
        self.r: F = None
        self.y: B = None
        self.u: E = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: G = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: D = None
        self.txt = txt

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

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

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

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