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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

n = A("n")
f = B("f")
m = C("m")
l = D("l")
j = E("j")
k = F("k")
b = G("b")
d = A("d")
a = D("a")
h = C("h")

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

n = A("n")
f = B("f")
m = C("m")
l = D("l")
j = E("j")
k = F("k")
b = G("b")
d = A("d")
a = D("a")
h = C("h")

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