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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: E = None
        self.r: E = None
        self.v: B = None
        self.q: E = None
        self.w: E = None
        self.z: C = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: E = None
        self.t: H = None
        self.y: D = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: B = None
        self.r: E = None
        self.u: B = None
        self.x: H = None
        self.w: E = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.r: F = None
        self.q: F = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: E = None
        self.r: E = None
        self.v: B = None
        self.q: E = None
        self.w: E = None
        self.z: C = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: E = None
        self.t: H = None
        self.y: D = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: B = None
        self.r: E = None
        self.u: B = None
        self.x: H = None
        self.w: E = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.r: F = None
        self.q: F = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

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

n.v = f
d.u = h
m.x = a
m.u = d
m.z = d
m.t = h
m.q = c
m.w = c
m.v = l
h.t = m
h.z = m
h.y = c
h.r = c
h.q = c
h.w = c
h.v = d
h.x = j
c.t = l
c.u = m
c.y = a
f.s = c
f.r = c
f.q = c
f.t = j
f.y = h
l.v = h
l.t = d
l.u = d
l.y = d
l.r = c
l.w = c
l.x = a
j.y = f
j.r = f
j.q = f
j.o = c
j.v = c
j.z = c
a.y = f
a.r = f
a.q = f
a.o = c
a.v = c
a.z = c
assert l.v.v.u.txt == "h"