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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.z: G = None
        self.s: A = None
        self.w: E = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: H = None
        self.s: B = None
        self.txt = txt

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

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

n = A("n")
d = B("d")
b = C("b")
g = D("g")
e = E("e")
m = F("m")
j = G("j")
h = H("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.z: G = None
        self.s: A = None
        self.w: E = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: H = None
        self.s: B = None
        self.txt = txt

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

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

n = A("n")
d = B("d")
b = C("b")
g = D("g")
e = E("e")
m = F("m")
j = G("j")
h = H("h")

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