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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.r: D = None
        self.s: D = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.y: C = None
        self.x: A = None
        self.u: D = None
        self.txt = txt

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

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

b = A("b")
n = B("n")
g = C("g")
l = D("l")
h = E("h")
c = F("c")
d = G("d")
a = H("a")
i = F("i")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.r: D = None
        self.s: D = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.y: C = None
        self.x: A = None
        self.u: D = None
        self.txt = txt

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

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

b = A("b")
n = B("n")
g = C("g")
l = D("l")
h = E("h")
c = F("c")
d = G("d")
a = H("a")
i = F("i")

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