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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: C = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: F = None
        self.o: E = None
        self.p: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.x: A = None
        self.w: G = None
        self.r: A = None
        self.q: D = None
        self.y: C = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: C = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: F = None
        self.o: E = None
        self.p: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.x: A = None
        self.w: G = None
        self.r: A = None
        self.q: D = None
        self.y: C = None
        self.t: B = None
        self.txt = txt

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

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