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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: A = None
        self.t: A = None
        self.v: D = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: D = None
        self.y: C = None
        self.w: D = None
        self.t: F = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: E = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: A = None
        self.t: A = None
        self.v: D = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: D = None
        self.y: C = None
        self.w: D = None
        self.t: F = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: E = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

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

m.q = d
e.x = a
j.y = c
j.s = m
j.t = m
j.q = m
j.v = d
j.w = f
d.v = g
d.p = j
h.t = l
h.z = f
f.w = m
a.q = h
a.z = d
a.y = j
a.u = j
a.w = c
a.t = f
a.x = l
g.q = j
g.r = h
g.p = d
g.y = e
l.x = a
c.v = g
c.p = j
assert g.p.v.r.t.x.z.p.v.txt == "d"