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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: A = None
        self.txt = txt

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

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

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

n.o = a
a.o = d
a.w = k
c.r = b
b.u = a
b.y = f
f.s = c
f.p = n
h.w = d
h.o = n
h.r = n
h.s = a
h.p = b
d.t = f
d.s = b
d.u = b
d.o = n
d.y = h
l.t = f
l.s = b
l.u = b
l.o = n
l.y = h
k.s = c
k.p = n
assert n.o.o.y.s.o.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: A = None
        self.txt = txt

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

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

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

n.o = a
a.o = d
a.w = k
c.r = b
b.u = a
b.y = f
f.s = c
f.p = n
h.w = d
h.o = n
h.r = n
h.s = a
h.p = b
d.t = f
d.s = b
d.u = b
d.o = n
d.y = h
l.t = f
l.s = b
l.u = b
l.o = n
l.y = h
k.s = c
k.p = n
assert n.o.o.y.s.o.s.u.txt == "a"