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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: F = None
        self.z: H = None
        self.u: F = None
        self.x: C = None
        self.q: C = None
        self.t: H = None
        self.txt = txt

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

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

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

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

a = A("a")
h = B("h")
c = C("c")
f = D("f")
g = E("g")
k = F("k")
n = G("n")
b = H("b")
d = D("d")
j = B("j")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: F = None
        self.z: H = None
        self.u: F = None
        self.x: C = None
        self.q: C = None
        self.t: H = None
        self.txt = txt

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

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

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

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

a = A("a")
h = B("h")
c = C("c")
f = D("f")
g = E("g")
k = F("k")
n = G("n")
b = H("b")
d = D("d")
j = B("j")

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