class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: C = None
        self.x: C = None
        self.z: F = None
        self.o: E = None
        self.y: H = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: G = None
        self.x: A = None
        self.u: D = None
        self.r: C = None
        self.p: A = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: G = None
        self.x: A = None
        self.u: D = None
        self.r: C = None
        self.p: A = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: E = None
        self.txt = txt

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

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

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