class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.z: H = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.z: H = None
        self.r: E = None
        self.o: H = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: G = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: E = None
        self.u: H = None
        self.o: H = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.w: A = None
        self.v: C = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.z: H = None
        self.r: E = None
        self.o: H = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: G = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: E = None
        self.u: H = None
        self.o: H = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.w: A = None
        self.v: C = None
        self.p: C = None
        self.txt = txt

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

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