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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

l.w = b
c.y = k
d.o = i
d.p = a
d.t = a
a.q = n
a.o = g
g.o = h
g.y = b
i.o = c
i.x = c
i.v = c
k.o = i
k.s = h
h.o = g
h.y = b
b.o = i
b.p = a
b.t = a
n.w = b
assert n.w.o.o.y.o.o.y.s.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

l.w = b
c.y = k
d.o = i
d.p = a
d.t = a
a.q = n
a.o = g
g.o = h
g.y = b
i.o = c
i.x = c
i.v = c
k.o = i
k.s = h
h.o = g
h.y = b
b.o = i
b.p = a
b.t = a
n.w = b
assert n.w.o.o.y.o.o.y.s.o.o.txt == "h"