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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: B = None
        self.q: E = None
        self.w: C = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: E = None
        self.q: D = None
        self.z: C = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: D = None
        self.z: A = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.w: E = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: B = None
        self.q: E = None
        self.w: C = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: E = None
        self.q: D = None
        self.z: C = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: D = None
        self.z: A = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.w: E = None
        self.z: B = None
        self.txt = txt

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

d.o = n
a.z = f
i.u = l
i.x = n
f.v = h
f.u = h
f.p = a
f.q = l
f.w = i
f.t = b
k.t = c
k.x = l
k.q = f
k.z = i
k.p = i
k.w = i
n.w = d
n.z = d
n.o = h
n.u = l
n.y = b
c.y = n
c.x = k
c.w = l
c.z = b
l.t = c
l.x = k
l.q = h
l.z = i
l.p = i
l.w = i
h.v = f
h.u = f
h.p = a
h.t = a
h.q = l
h.w = i
b.z = f
assert d.o.w.o.o.q.t.w.q.txt == "h"