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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.w: E = None
        self.o: A = None
        self.v: H = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.w: E = None
        self.o: A = None
        self.v: H = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: A = None
        self.txt = txt

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

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