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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: F = None
        self.o: E = None
        self.x: E = None
        self.y: H = None
        self.t: H = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: D = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: F = None
        self.o: E = None
        self.x: E = None
        self.y: H = None
        self.t: H = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: D = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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