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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.s: E = None
        self.v: D = None
        self.p: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.v: D = None
        self.r: G = None
        self.s: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: E = None
        self.v: F = None
        self.r: D = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.s: E = None
        self.v: D = None
        self.p: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.v: D = None
        self.r: G = None
        self.s: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: E = None
        self.v: F = None
        self.r: D = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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