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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: E = None
        self.w: E = None
        self.txt = txt

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

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

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