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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: D = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: F = None
        self.txt = txt

f = A("f")
j = B("j")
c = C("c")
l = D("l")
h = E("h")
n = F("n")
m = G("m")
d = H("d")
e = E("e")

f.t = m
f.v = e
f.w = c
j.z = c
c.o = d
l.q = d
h.q = d
h.x = l
h.w = l
h.s = l
n.t = h
m.s = n
m.p = n
m.z = c
m.w = f
m.q = f
m.x = l
m.o = j
d.q = e
d.p = n
e.q = d
e.x = l
e.w = l
e.s = l
assert m.w.t.o.z.o.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: D = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: F = None
        self.txt = txt

f = A("f")
j = B("j")
c = C("c")
l = D("l")
h = E("h")
n = F("n")
m = G("m")
d = H("d")
e = E("e")

f.t = m
f.v = e
f.w = c
j.z = c
c.o = d
l.q = d
h.q = d
h.x = l
h.w = l
h.s = l
n.t = h
m.s = n
m.p = n
m.z = c
m.w = f
m.q = f
m.x = l
m.o = j
d.q = e
d.p = n
e.q = d
e.x = l
e.w = l
e.s = l
assert m.w.t.o.z.o.q.q.q.txt == "e"