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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.z: G = None
        self.q: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.v: G = None
        self.p: F = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.z: G = None
        self.q: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.v: G = None
        self.p: F = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

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

b.v = k
m.u = d
m.v = k
m.x = k
g.r = d
g.x = n
g.z = k
g.q = c
g.t = c
f.v = n
f.s = l
f.t = k
f.z = k
f.u = b
f.q = b
f.o = b
f.w = c
n.u = c
d.o = m
d.s = k
d.r = h
d.z = h
d.q = h
d.x = b
d.w = g
d.t = f
k.p = b
k.r = b
k.u = h
k.z = l
k.w = g
h.u = m
h.s = d
h.p = d
h.v = k
h.w = c
h.z = b
c.r = d
c.x = n
c.z = k
c.q = g
c.t = g
l.v = n
l.s = f
l.t = k
l.z = k
l.u = b
l.q = b
l.o = b
l.w = g
assert g.z.p.v.z.txt == "l"