class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: F = None
        self.q: D = None
        self.o: H = None
        self.p: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: D = None
        self.z: H = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.v: C = None
        self.u: C = None
        self.z: H = None
        self.x: B = None
        self.txt = txt

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

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

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

d = A("d")
n = B("n")
l = C("l")
a = D("a")
g = E("g")
m = F("m")
k = G("k")
j = H("j")
h = D("h")

d.w = n
d.v = m
d.q = h
d.o = j
d.p = j
n.q = a
n.r = d
n.s = d
n.v = l
l.x = j
a.r = n
a.w = n
a.y = h
a.z = j
g.q = m
g.w = m
g.v = l
g.u = l
g.z = j
g.x = n
m.v = n
k.q = m
k.v = d
j.p = m
j.u = d
j.z = n
h.r = n
h.w = n
h.y = a
h.z = j
assert g.q.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: F = None
        self.q: D = None
        self.o: H = None
        self.p: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: D = None
        self.z: H = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.v: C = None
        self.u: C = None
        self.z: H = None
        self.x: B = None
        self.txt = txt

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

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

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

d = A("d")
n = B("n")
l = C("l")
a = D("a")
g = E("g")
m = F("m")
k = G("k")
j = H("j")
h = D("h")

d.w = n
d.v = m
d.q = h
d.o = j
d.p = j
n.q = a
n.r = d
n.s = d
n.v = l
l.x = j
a.r = n
a.w = n
a.y = h
a.z = j
g.q = m
g.w = m
g.v = l
g.u = l
g.z = j
g.x = n
m.v = n
k.q = m
k.v = d
j.p = m
j.u = d
j.z = n
h.r = n
h.w = n
h.y = a
h.z = j
assert g.q.v.v.txt == "l"