class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: H = None
        self.q: G = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.u: C = None
        self.s: H = None
        self.x: C = None
        self.t: H = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.p: C = None
        self.o: C = None
        self.v: A = None
        self.y: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.u: C = None
        self.s: H = None
        self.x: C = None
        self.t: H = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.p: C = None
        self.o: C = None
        self.v: A = None
        self.y: G = None
        self.txt = txt

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

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

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

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