class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: B = None
        self.s: E = None
        self.w: B = None
        self.o: E = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: G = None
        self.o: A = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: D = None
        self.y: B = None
        self.o: B = None
        self.x: C = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: G = None
        self.o: A = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: D = None
        self.y: B = None
        self.o: B = None
        self.x: C = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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

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