class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: D = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: C = None
        self.p: F = None
        self.o: A = None
        self.w: C = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: D = None
        self.v: F = None
        self.txt = txt

d = A("d")
b = B("b")
a = C("a")
k = D("k")
i = E("i")
n = F("n")
j = G("j")
h = G("h")

d.o = i
b.x = k
b.y = k
b.s = k
b.p = a
a.q = i
a.o = b
a.w = k
k.z = d
k.y = n
k.w = j
i.q = b
i.r = a
i.w = a
i.p = n
i.u = n
i.t = n
i.o = d
n.q = b
n.r = b
n.z = a
n.x = a
n.u = i
n.w = j
n.t = h
j.q = b
j.t = k
j.v = n
h.q = b
h.t = k
h.v = n
assert n.r.x.w.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: D = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: C = None
        self.p: F = None
        self.o: A = None
        self.w: C = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: D = None
        self.v: F = None
        self.txt = txt

d = A("d")
b = B("b")
a = C("a")
k = D("k")
i = E("i")
n = F("n")
j = G("j")
h = G("h")

d.o = i
b.x = k
b.y = k
b.s = k
b.p = a
a.q = i
a.o = b
a.w = k
k.z = d
k.y = n
k.w = j
i.q = b
i.r = a
i.w = a
i.p = n
i.u = n
i.t = n
i.o = d
n.q = b
n.r = b
n.z = a
n.x = a
n.u = i
n.w = j
n.t = h
j.q = b
j.t = k
j.v = n
h.q = b
h.t = k
h.v = n
assert n.r.x.w.t.z.txt == "d"