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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

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

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

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

h = A("h")
e = B("e")
i = C("i")
f = D("f")
m = E("m")
d = F("d")
l = G("l")
b = A("b")
a = D("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

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

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

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

h = A("h")
e = B("e")
i = C("i")
f = D("f")
m = E("m")
d = F("d")
l = G("l")
b = A("b")
a = D("a")

h.w = e
e.r = d
e.y = m
e.t = f
i.o = f
i.v = a
i.y = e
i.x = e
i.z = e
i.s = d
f.z = m
f.q = e
f.w = a
m.p = d
m.s = e
d.t = m
d.v = m
d.x = h
d.z = e
d.s = e
d.u = b
l.v = i
l.x = i
l.w = d
l.o = d
l.t = b
b.w = e
a.z = m
a.q = e
a.w = f
assert h.w.t.q.y.s.r.z.r.txt == "d"