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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: E = None
        self.x: A = None
        self.q: A = None
        self.y: E = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: F = None
        self.q: D = None
        self.p: A = None
        self.o: B = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: G = None
        self.y: 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.x: F = None
        self.w: A = None
        self.v: D = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: G = None
        self.u: C = None
        self.p: C = None
        self.t: D = None
        self.q: D = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

j = A("j")
f = B("f")
g = C("g")
n = D("n")
i = E("i")
h = F("h")
l = G("l")
d = H("d")

j.w = d
j.v = d
f.v = i
f.p = i
f.y = i
f.x = j
f.q = j
f.o = d
g.r = n
g.q = n
g.t = n
g.v = h
g.z = h
g.p = j
g.o = f
n.w = l
i.r = g
i.w = l
i.y = n
h.t = i
l.x = h
l.w = j
l.v = n
l.z = i
d.x = j
d.r = j
d.z = l
d.u = g
d.p = g
d.t = n
d.q = n
d.v = h
assert g.q.w.w.v.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: E = None
        self.x: A = None
        self.q: A = None
        self.y: E = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: F = None
        self.q: D = None
        self.p: A = None
        self.o: B = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: G = None
        self.y: 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.x: F = None
        self.w: A = None
        self.v: D = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: G = None
        self.u: C = None
        self.p: C = None
        self.t: D = None
        self.q: D = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

j = A("j")
f = B("f")
g = C("g")
n = D("n")
i = E("i")
h = F("h")
l = G("l")
d = H("d")

j.w = d
j.v = d
f.v = i
f.p = i
f.y = i
f.x = j
f.q = j
f.o = d
g.r = n
g.q = n
g.t = n
g.v = h
g.z = h
g.p = j
g.o = f
n.w = l
i.r = g
i.w = l
i.y = n
h.t = i
l.x = h
l.w = j
l.v = n
l.z = i
d.x = j
d.r = j
d.z = l
d.u = g
d.p = g
d.t = n
d.q = n
d.v = h
assert g.q.w.w.v.x.v.txt == "d"