class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: D = None
        self.t: H = None
        self.v: E = None
        self.s: B = None
        self.y: B = None
        self.x: E = None
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: F = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.o: D = None
        self.q: E = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.w: F = None
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: F = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.o: D = None
        self.q: E = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.w: F = None
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

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