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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.q: C = None
        self.txt = txt

j = A("j")
i = B("i")
d = C("d")
l = D("l")
k = E("k")
f = F("f")
c = G("c")
e = H("e")

j.v = f
j.y = i
j.q = i
i.q = l
d.w = c
l.t = k
l.w = k
l.z = i
l.v = c
l.x = f
k.o = j
f.u = j
f.x = j
f.t = k
f.z = l
f.v = c
f.o = i
c.s = f
c.t = i
e.o = j
e.u = i
e.q = d
assert k.o.v.o.q.z.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.q: C = None
        self.txt = txt

j = A("j")
i = B("i")
d = C("d")
l = D("l")
k = E("k")
f = F("f")
c = G("c")
e = H("e")

j.v = f
j.y = i
j.q = i
i.q = l
d.w = c
l.t = k
l.w = k
l.z = i
l.v = c
l.x = f
k.o = j
f.u = j
f.x = j
f.t = k
f.z = l
f.v = c
f.o = i
c.s = f
c.t = i
e.o = j
e.u = i
e.q = d
assert k.o.v.o.q.z.q.v.txt == "c"