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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: A = None
        self.r: E = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: D = None
        self.t: A = None
        self.r: D = None
        self.s: H = None
        self.w: A = None
        self.u: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: A = None
        self.r: E = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: D = None
        self.t: A = None
        self.r: D = None
        self.s: H = None
        self.w: A = None
        self.u: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.txt = txt

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

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